<?php


namespace app\api\controller;

use app\api\logic\WechatLogic;
use app\api\validate\WechatValidate;

/**
 * 微信控制器
 * Class WechatController
 * @package app\api\controller
 */
class WechatController extends BaseShopController
{
    public array $notNeedLogin = ['jsConfig'];
    /**
     * @notes 微信JSSDK授权接口
     * @return \think\response\Json
     * @author Tab
     * @date 2021/8/30 19:20
     */
    public function jsConfig()
    {
        $params = (new WechatValidate())->goCheck('jsConfig');
        $result = WechatLogic::jsConfig($params);
        if ($result === false) {
            return $this->fail(WechatLogic::getError());
        }
        return $this->data($result);
    }
}